home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
recent2
/
yamtools.lha
/
yamtools1.4
/
YTDelete.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-03-01
|
9KB
|
269 lines
/******************************************************************************/
/* */
/* YTDelete */
/* Copyright ©1997 by Dick Whiting */
/* */
/*----------------------------------------------------------------------------*/
/* This script requires YAMTOOLS for it to work. If you don't have YAMTOOLS */
/* you can get it on Aminet in directory comm/mail. This script allows you */
/* to Delete all selected mail. This is only really useful from */
/* the mail list of a SEARCH. Otherwise, use YAM's normal capabilities. */
/* */
/*----------------------------------------------------------------------------*/
/* */
/* Standard Disclaimer: I wrote it, it works for me, I don't guarantee */
/* that it will do anything productive for anyone else, etc. etc. ;-) */
/* */
/*HOWEVER, if you DO find a use for it: I homeschool my kids and they */
/*would love a postcard from where EVER you live. */
/* */
/*Instant GEOGRAPHY lesson;) */
/* */
/* */
/*POSTCARDS: Dick Whiting */
/* 28590 S. Beavercreek Rd. */
/* Mulino, Oregon 97042 */
/* USA */
/* */
/*----------------------------------------------------------------------------*/
/* */
/* Address Bug Reports or Comments to: */
/* Dick Whiting <dwhiting@europa.com> */
/* 28 February 1997 */
/* */
/******************************************************************************/
/*
$VER: 1.0 Copyright ©1997 by Dick Whiting
$AUTHOR: Dick Whiting
$DESCRIPTION: Deleter for use with YAMTOOLS
*/
options results
options failat 9999 /* keep maildelete return from showing */
MUIA_List_Entries = 0x80421654
MUIA_VertWeight = 0x804298d0
MUIA_Window_DepthGadget = 0x80421923
MUIA_Window_DragBar = 0x8042045d
MUIA_Window_PublicScreen = 0x804278e4
MUIA_Window_SizeGadget = 0x8042e33d
TRUE=1
FALSE=0
help.SQUIT=''
node.SQUIT=''
help.STEXT=''
node.STEXT=''
missing='.'
Address YAMTOOLS
Call CheckYam
Call CheckMailList
Call ProcessDeletes
exit
/**************************************************************************/
/* Check that there is some mail to process */
/**************************************************************************/
CheckMailList:
list ID MLST ATTRS MUIA_List_Entries
mcnt=result
if mcnt=0 then do
errmsg='You need to CHOOSE mail to Delete'
Call ErrorMsg
end
Return
/**************************************************************************/
/* Process Deletes */
/**************************************************************************/
ProcessDeletes:
request ID VERD GADGETS '"OK|CANCEL"' '"Delete selected entries?"'
if result=0 then exit
infotitle='"YAM Tools Info"'
infotext='\033nDeleting Mail...'
infobuttons='"Continue,Interrupt,Abort"'
showbusy=TRUE
Call InfoWindow
list ID MLST ATTRS MUIA_List_Entries
mcnt=result
Deletelist.=missing
Deletelist.0=0
Updlist.=missing
Updlist.0=0
acnt=0
do i=0 to mcnt-1
list ID MLST
mline=result
if mline='' then break
parse var mline arch ',' from ',' subj ',' mfor ',' mnum ',' anum ',' file
acnt=acnt+1
anum=right(anum,6,'0')
mnum=right(mnum,6,'0')
Deletelist.0=acnt
Deletelist.acnt=anum mnum file subj
radio ID SQUIT
if result~="Continue" then leave
end
Updlist.0=Deletelist.0
if acnt=0 then do
errmsg='You need to SELECT mail to Delete'
Call ErrorMsg
end
if show('L','rexxtricks.library') then do /* use tricks library */
call QSORT(Deletelist) /* sort by name, line number */
end
else do /* use QuickSort format */
call QSORT(1, Deletelist.0, Deletelist) /* sort by name, number */
end
do i=Deletelist.0 to 1 by -1 /* process in reverse order */
anum=word(Deletelist.i,1)
anum=strip(anum,'L','0')
if anum='' then anum=0
mnum=word(Deletelist.i,2)
mnum=strip(mnum,'L','0')
if mnum='' then mnum=0
file=word(Deletelist.i,3)
subj=subword(Deletelist.i,4)
Updlist.i=anum
Updlist.i.1=mnum
Updlist.i.1.1=file
Updlist.i.1.1.1=subj
Address YAM 'setfolder 'anum /* goto folder */
Address YAM 'setmail 'mnum /* set to mail */
Address YAM "getmailinfo file" /* verify filename */
xfile=result
xlen=length(file)
xfile=right(xfile,xlen)
Address YAM "getmailinfo subject" /* verify subject */
xsubj=result
xsubj=translate(xsubj,' ',',')
if file~=xfile | xsubj~=subj then do
Updlist.i.1.1.1.1='\033berror'
end
else do
Updlist.i.1.1.1.1='\033bDeleted'
Address YAM "maildelete"
end
end
do i=1 to Updlist.0
do j=0 to mcnt-1
list ID MLST POS j
mline=result
if mline='' then break
parse var mline arch ',' from ',' subj ',' mfor ',' mnum ',' anum ',' file
if Updlist.i=anum & Updlist.i.1=mnum then do
arch=Updlist.i.1.1.1.1
mline=arch||','||from||','||subj||','||mfor||','||mnum||','||anum||','||file
list ID MLST POS j STRING mline
iterate i
end
end
end
window ID YTINF CLOSE
Return
/**************************************************************************/
/* Make sure YAM and YAMTOOLS are running. Show YAM. */
/**************************************************************************/
CheckYAM:
if ~show('p','YAMTOOLS') then do
errmsg='You need YAMTOOLS running to use YTDelete'
say errmsg
exit
end
if ~show('p','YAM') then do
errmsg='You need YAM running to use YTDelete'
Call ErrorMsg
exit
end
Address YAM 'show' /* uniconify YAM's screen */
Address YAM 'info SCREEN' /* get YAM's screen */
screen=result
if screen='' then screen='Workbench'
Return
/******************************************************************************/
/* Display ERROR message and EXIT. */
/******************************************************************************/
ErrorMsg:
window ID YTINF CLOSE
request ID ERRM GADGETS '"OK"' errmsg
exit
Return
/******************************************************************************/
/* Simple information/error message window. */
/******************************************************************************/
InfoWindow:
window ID YTINF TITLE '"YAM Deleter Info"' ATTRS MUIA_Window_PublicScreen screen,
MUIA_Window_SizeGadget FALSE MUIA_Window_DragBar FALSE,
MUIA_Window_DepthGadget FALSE
group
group
text ID STEXT HELP help.STEXT NODE node.STEXT LABEL infotext
endgroup
if showbusy then do
group
object CLASS '"Busy.mcc"' ATTRS MUIA_VertWeight 25
endgroup
end
if infobuttons ~='' then do
group HORIZ
group
space HORIZ
endgroup
group
radio ID SQUIT HELP help.SQUIT NODE node.SQUIT LABELS infobuttons
endgroup
group
space HORIZ
endgroup
endgroup
end
else do
group
space HORIZ 100
endgroup
end
endgroup
endwindow
Return
/**************************************************************************/
/* End of Active Code */
/**************************************************************************/